package com.soft.javase.day06.regex;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/24
 */
public class PersonInfo {
    public static void main(String[] args) {
        String text = "  anglebaby          女          18          515151511  ";

        String[] arr = text.trim().split("\\s+");

        String name = arr[0];
        String gender = arr[1];
        int age = Integer.parseInt(arr[2]);
        String qqNumber = arr[3];

        String regex = "[1-9]\\d{4,11}";
        if (qqNumber.matches(regex)) {
            System.out.println("QQ号合法！");
        }else {
            System.out.println("QQ号不合法！");
        }

        Person person = new Person(name, gender, age, qqNumber);
        System.out.println(person);
    }
}
